﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudentsInfor.Model
{
    /// <summary>
    /// 创建一个学生类
    /// </summary>
    public class Student
    {
        //创建学生的姓名学号电话成绩出生日期
        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 学号
        /// </summary>
        public string Number { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string Mobile { get; set; }
        /// <summary>
        /// 成绩
        /// </summary>
        public int Grade { get; set; }
        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime Birth { get; set; }
        /// <summary>
        /// 只读信息：年龄
        /// </summary>
        public int Age
        {
            get
            {
                return DateTime.Now.Year - Birth.Year;
            }
        }
    }
}
